From: thequackdaddy Date: Tue, 20 Dec 2016 16:10:22 +0000 (-0600) Subject: [PATCH] MAINT: test_anova.py fails on pandas 0.19.0 because stringio closes after... X-Git-Tag: archive/raspbian/0.11.1-2+rpi1~2^2^2^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=82f57bea59297f33bd5772830ec0eb535a67636f;p=statsmodels.git [PATCH] MAINT: test_anova.py fails on pandas 0.19.0 because stringio closes after read_table. Make read_table global to fix. Gbp-Pq: Name workaround_panda_readtable_bug.patch --- diff --git a/statsmodels/stats/tests/test_anova.py b/statsmodels/stats/tests/test_anova.py index 09c0a0a..e236efe 100644 --- a/statsmodels/stats/tests/test_anova.py +++ b/statsmodels/stats/tests/test_anova.py @@ -71,13 +71,15 @@ kidney_table = StringIO("""Days Duration Weight ID 1.0 2 3 10 """) +kidney_table.seek(0) +kidney_table = read_table(kidney_table, sep="\s+") + class TestAnovaLM(object): @classmethod def setupClass(cls): # kidney data taken from JT's course # don't know the license - kidney_table.seek(0) - cls.data = read_table(kidney_table, sep="\s+") + cls.data = kidney_table cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight)', data=cls.data).fit() @@ -100,8 +102,7 @@ class TestAnovaLMNoconstant(object): def setupClass(cls): # kidney data taken from JT's course # don't know the license - kidney_table.seek(0) - cls.data = read_table(kidney_table, sep="\s+") + cls.data = kidney_table cls.kidney_lm = ols('np.log(Days+1) ~ C(Duration) * C(Weight) - 1', data=cls.data).fit()